package com.demo.util;

import com.alibaba.fastjson.JSONObject;

public class Mail {
	
	private static final String BIND = "绑定邮箱";
	
	private static final String CHANGE_BIND = "更换绑定邮箱";
	// 收件人邮箱
	private String email;
	// 主题
	private String subject;
	// 内容
	private String content;
	// type
	private int type;// 1 为绑定邮箱   2为更换绑定邮箱
	
	
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	
	
	public Mail(String email, int type,String content) {
		this.email = email;
		if(type==1){
			this.subject = BIND;
		}else if(type==2){
			this.subject = CHANGE_BIND;
		}
		this.content = content;
	}
	public Mail(String email, String subject, String content) {
		super();
		this.email = email;
		this.subject = subject;
		this.content = content;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getSubject() {
		return subject;
	}
	public void setSubject(String subject) {
		this.subject = subject;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	@Override
	public String toString() {
		JSONObject json = new JSONObject();
      	 json.put("email", email);
	     json.put("subject", subject);
	     json.put("content", content);
		return json.toString();
	}
	
}
